﻿using System;

namespace KinectServer.Module
{
    public static class Log
    {
        public static Action<String> Output { get; set; }

        public static void d(Object from, String message)
        {
            print("디버그", from, message);
        }

        public static void i(Object from, String message)
        {
            print("메세지", from, message);
        }

        public static void e(Object from, String message)
        {
            print("에러", from, message);
        }

        private static void print(String prefix, Object from, String message)
        {
            if (Output != null)
            {
                Output(String.Format("[{0}] {1}: {2}{3}", prefix, from.GetType().FullName, message, Environment.NewLine));
            }
        }
    }
}
